package edu.csl.study.shardingsphere.health.controller;


import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import edu.csl.study.shardingsphere.health.entity.User;
import edu.csl.study.shardingsphere.health.service.IUserService;
import edu.csl.study.shardingsphere.hint.HintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 自动生成代码
 * @since 2022-05-19
 */
@RestController
@RequestMapping("/hit")
public class HitController {
    @Autowired
    HintService service;

    @RequestMapping("/db")
    public String db() throws SQLException, IOException {

        service.processWithHintValueForShardingDatabases();
        return " Databases SUCCESS";
    }
    @RequestMapping("/dbtb")
    public String dbtb() throws SQLException, IOException {

        service.processWithHintValueForShardingDatabasesAndTables();
        return " DatabasesAndTables SUCCESS";
    }
    @RequestMapping("/ms")
    public String ms() throws SQLException, IOException {

        service.processWithHintValueMaster();
        return " Master SUCCESS";
    }


}
